package zsy.test.设计模式.singleton;

/**
 * 懒汉式单例：线程不安全，可以看下DCL双重校验锁单例
 *
 * @author zhangshuaiyin
 * @date 2022/8/8 10:19
 */
public class LazySingleton {
    private static LazySingleton instance;

    private LazySingleton() {
    }

    public static LazySingleton getInstance() {
        if (instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
